<template>
  <a-layout>
    <!-- Header -->
    <a-layout-header class="main-header">智悦银剪</a-layout-header>
  </a-layout>
  <div class="register-page">
    <h1>注册账号</h1>
    <div class="goToLoginPage">
      <a href="#" @click.prevent="goToLoginPage" class="link-style">已有账号？点击我登录！</a>
    </div>
    <form @submit.prevent="handleSubmit">
      <div class="form-group">
        <label for="user-type">用户类型：</label>
        <select style="width: 250px;font-size: 25px" id="user-type" v-model="userType" required>
          <option value="客户">客户</option>
          <option value="理发师">理发师</option>
        </select>
      </div>
      <div class="form-group">
        <label for="username">用户姓名：</label>
        <input type="text" id="username" v-model="username" required>
      </div>
      <div class="form-group">
        <label for="phone">电话号码：</label>
        <input type="tel" id="phone" v-model="phone" required>
      </div>
      <div v-if="userType !== '客户'" class="form-group">
        <label for="qualification">资质证明：</label>
        <input type="file" id="qualification" @change="handleFileChange">
      </div>
      <div class="form-group">
        <label for="password">设置密码：</label>
        <input type="password" id="password" v-model="password" required>
      </div>
      <div class="form-group">
        <label for="confirmPassword">再次输入密码：</label>
        <input type="password" id="confirmPassword" v-model="confirmPassword" required>
      </div>
      <a-layout>
          <a-button class="submit" style="background-color: #99BB99" type="primary" size="large">提交</a-button>
      </a-layout>
    </form>
  </div>
</template>

<script>
export default {
  data() {
    return {
      userType: '客户',
      username: '',
      phone: '',
      qualification: null,
      password: '',
      confirmPassword: '',
    };
  },
  methods: {
    handleFileChange(event) {
      this.qualification = event.target.files[0];
    },
    handleSubmit() {
      // 在这里处理表单提交逻辑，例如验证输入、发送请求到服务器等
      console.log('提交表单:', {
        userType: this.userType,
        username: this.username,
        phone: this.phone,
        qualification: this.qualification,
        password: this.password,
        confirmPassword: this.confirmPassword,
      });
    },
    goToLoginPage() {
    }
  }
}
</script>

<style scoped>
.main-header {
  background: linear-gradient(to right, rgba(149,188,107,0.56),  rgba(127,170,41,0.56)); /* 渐变背景 */
  color: #000000;
  text-align: center;
  padding: 30px 20px; /* 增加上下内边距 */
  font-size: 26px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* 阴影效果 */
  display: flex;
  align-items: center;
  font-weight: bold;
  justify-content: center;
}
.register-page {
  font-family: Arial, sans-serif; /* 非衬线体 */
  font-size: 25px; /* 增大字体 */
  line-height: 1.8; /* 增大行间距 */
  margin: 0 auto;
  padding: 20px;
  border-radius: 10px; /* 增大圆角 */
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2); /* 增大阴影以提高可见性 */
  background-image: url('/images/背景.jpg');
  height: 1161px;
}

.register-page h1 {
  text-align: center;
  margin-bottom: 10px;
  font-size: 35px; /* 标题字体更大 */
  font-weight: bold;
}

.register-page .form-group {
  margin-bottom: 25px; /* 增大表单项之间的间距 */
  font-size: 25px;
}

.register-page label {
  display: block;
  margin-bottom: 0;
  font-weight: bold; /* 加粗标签以提高可读性 */
}

.register-page input,
.register-page select {
  width: 100%;
  padding: 12px;
  font-size: 25px; /* 增大输入框内的字体 */
  border: 1px solid #000; /* 更明显的输入框边框 */
  border-radius: 5px; /* 圆角输入框 */
  font-weight: bold;
  background-color: rgba(255, 255, 255, 0.5);
}


.register-page .goToLoginPage {
  text-align: center;
  margin-bottom: 15px;
  padding: 12px;
  box-sizing: border-box;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.register-page .link-style {
  color: #05471e; /* 使用率色链接以提高可见性 */
  font-size: 25px; /* 增大链接字体 */
  cursor: pointer;
}

.register-page .link-style:hover {
  text-decoration: none; /* 悬停时去掉下划线 */
}

.register-page .submit {
  display: flex;
  justify-content: center;
  margin: 0;
  background-color: transparent;
  height: 60px;
  font-size: 28px;
}
</style>